package com.huidu.bitrade.config;

//import com.huidu.bitrade.ext.SmartHttpSessionStrategy;
import org.springframework.context.annotation.Bean;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
//import org.springframework.session.web.http.CookieHttpSessionStrategy;
//import org.springframework.session.web.http.HeaderHttpSessionStrategy;
//import org.springframework.session.web.http.HttpSessionStrategy;


@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 60 * 60 * 24 * 7 )
public class HttpSessionConfig {

	@Bean
	public HeaderHttpSessionIdResolver httpSessionStrategy() {
		return new HeaderHttpSessionIdResolver("x-auth-token");
	}

//	 @Bean
//	 public HttpSessionStrategy httpSessionStrategy(){
//		 HeaderHttpSessionStrategy headerSession = new HeaderHttpSessionStrategy();
//		 CookieHttpSessionStrategy cookieSession = new CookieHttpSessionStrategy();
//		 headerSession.setHeaderName("x-auth-token");
//		 return new SmartHttpSessionStrategy(cookieSession,headerSession);
//	 }
}
